import request from "@/utils/request";
//封装与菜单相关的接口

//获取所有菜单信息
export const getAllMenus = () => {
  return request({
    method: "GET",
    url: "/boss/menu/getAll",
  });
};

//新增或编辑菜单接口函数
export const createOrUpdateMenu = (data) => {
  return request({
    method: "POST",
    url: "/boss/menu/saveOrUpdate",
    data,
  });
};

//根据id删除某个菜单
export const deleteMenu = (menuId = 0) => {
  return request({
    method: "DELETE",
    url: `/boss/menu/${menuId}`,
  });
};

//获取编辑菜单页面信息
export const getEditMenuInfo = (menuId) => {
  return request({
    method: "GET",
    url: "/boss/menu/getEditMenuInfo",
    params: {
      id: menuId,
    },
  });
};
